<?php
/**
 * Created by PhpStorm.
 * User: apanov
 * Date: 07.02.14
 * Time:
 */
class MenuTopAdminWidget extends abstractWidget {

    private $name = 'MenuTopAdmin';

    function __construct($input_data = null){

        parent::__construct();

        $this->input_data = $input_data;

    }

    function process(){

        if( is_null($this->widget_data) ){
            $this->setWidgetData();
        }

        if( isset($this->widget_data['template']) ){

            $modul_id = null;

            //XML
            $this->view->top_menu_admin_data = $this->prepairMenuArray();


            $this->html = $this->view->fetch($this->widget_data['template']);
        }

    }

    function prepairMenuArray()
    {
        $top_menu = $this->getXml('navigation', 'top_menu_admin');

        return $this->xmlMenuArrFormat($top_menu);

    }

}